package org.zfes.snowier.zbss.xzy.router.device.message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.web.util.FileResInfo;
import org.zfes.snowier.web.util.UploadUitl;
import org.zfes.snowier.zbss.xzy.base.HosConst;
import org.zfes.snowier.zbss.xzy.biz.message.service.IMessageService;
import org.zfes.snowier.zbss.xzy.biz.vedio.model.CloudImage;
import org.zfes.snowier.zbss.xzy.biz.vedio.service.ICloudImageService;
import org.zfes.snowier.zbss.xzy.biz.vedio.service.ICloudVedioService;
import org.zfes.snowier.zbss.xzy.message.MessagePusDto;
import org.zfes.snowier.zbss.xzy.sms.SmsTencentSender;
import org.zfes.snowier.zbss.xzy.tvedio.CloudCoverCreateDto;
import org.zfes.snowier.zbss.xzy.tvedio.CloudVedioCreateDto;

import com.google.common.collect.Lists;

import io.swagger.annotations.ApiOperation;

import org.zfes.snowier.core.util.UUIDUtil;
import org.zfes.snowier.core.util.ZAlert;
import org.zfes.snowier.core.util.ZAssert;
@Controller 
@RequestMapping("/api/device/message/test")
public class MessageTestController implements BaseController {

	
	  @ApiOperation(value = "报警信息上报")
      @RequestMapping(value="/alertMsg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
      public  @ResponseBody Object alertMsg(@RequestBody MessagePusDto message){
    	
    	return ajaxDoneSuccess("数据操作成功 ").put("messageId", 123);
      }
    
	  @ApiOperation(value = "报警信息-视频证据上报")
	  @RequestMapping(value="/uploadMsgVedio/{messageId}/{deviceNum}", method = RequestMethod.POST,
	  produces = MediaType.APPLICATION_JSON_VALUE,
	  consumes = { "application/x-www-form-urlencoded" } ,
	  headers = "content-type=multipart/form-data")
	  public  @ResponseBody Object uploadMsgVedio(@RequestParam("files") MultipartFile[] files,@PathVariable("messageId") Long messageId,@PathVariable("deviceNum") String deviceNum){

	    return ajaxDoneSuccess("数据操作成功 ").put("vedioId", 456);
	  }
	  
	  @ApiOperation(value = "报警信息-图片证据上传")
	  @RequestMapping(value="/uploadMsgImage/{messageId}/{deviceNum}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
	  public  @ResponseBody Object uploadMsgImage(@RequestParam("image") MultipartFile image,@PathVariable("messageId") Long messageId,@PathVariable("deviceNum") String deviceNum){
		  
	    return ajaxDoneSuccess("数据操作成功 ").put("imageId", 789);
	  }
	
}